Add non-intrusive support for AWS to Vagrantfile

This changeset adds support for AWS provisioning to
Vagrantfile. It won't get in the way of regular users
who want to just use Virtualbox.

The AWS provider will be required only if the user does:

vagrant up --provider=aws

Konstantin Nazarov 11 years ago
parent
commit
22d1cf95ac
1 changed files with 16 additions and 0 deletions
  1. 16 0
      deployment/Vagrantfile

+ 16 - 0
deployment/Vagrantfile

@@ -21,4 +21,20 @@ Vagrant.configure("2") do |config|
21 21
   config.vm.provider :parallels do |prl, override|
22 22
     override.vm.box = "parallels/ubuntu-12.04"
23 23
   end
24
+
25
+  config.vm.provider :aws do |aws, override|
26
+    aws.ami = ENV['AWS_AMI'] || "ami-828675f5"
27
+    aws.region = ENV['AWS_REGION'] || "eu-west-1"
28
+    aws.instance_type = "t1.micro"
29
+
30
+    override.vm.box = "dummy"
31
+    override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
32
+    override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
33
+    override.ssh.username = ENV['AWS_SSH_USER'] || "ubuntu"
34
+
35
+    aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
36
+    aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
37
+    aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
38
+    aws.security_groups = [ ENV["AWS_SECURITY_GROUP"] ]
39
+  end
24 40
 end